package com.jiyun.controller;

import com.jiyun.entity.Stu;
import com.jiyun.mapper.StuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/stu")
public class StuController {


    @Autowired
    StuMapper stuMapper;

    @RequestMapping("/findAll")
    public List<Stu> findAll(){

        return  stuMapper.selectList(null);

    }

    @RequestMapping("/findById")
    public Stu findById(@RequestParam("id") Integer id,String name){
        //xxx
        return stuMapper.selectById(id);
    }


}
